package com.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.jianchaxiangmuxinxiDao;
import com.entity.jianchaxiangmuxinxiEntity;
import com.entity.view.jianchaxiangmuxinxiView;
import com.entity.vo.jianchaxiangmuxinxiVO;
import com.service.jianchaxiangmuxinxiService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("jianchaxiangmuxinxiService")
public class jianchaxiangmuxinxiServiceImpl extends ServiceImpl<jianchaxiangmuxinxiDao, jianchaxiangmuxinxiEntity> implements jianchaxiangmuxinxiService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<jianchaxiangmuxinxiEntity> page = this.selectPage(
                new Query<jianchaxiangmuxinxiEntity>(params).getPage(),
                new EntityWrapper<jianchaxiangmuxinxiEntity>()
        );
        return new PageUtils(page);
    }

    @Override
	public PageUtils queryPage(Map<String, Object> params, Wrapper<jianchaxiangmuxinxiEntity> wrapper) {
		  Page<jianchaxiangmuxinxiView> page =new Query<jianchaxiangmuxinxiView>(params).getPage();
	        page.setRecords(baseMapper.selectListView(page,wrapper));
	    	PageUtils pageUtil = new PageUtils(page);
	    	return pageUtil;
 	}

    @Override
	public List<jianchaxiangmuxinxiVO> selectListVO(Wrapper<jianchaxiangmuxinxiEntity> wrapper) {
 		return baseMapper.selectListVO(wrapper);
	}

	@Override
	public jianchaxiangmuxinxiVO selectVO(Wrapper<jianchaxiangmuxinxiEntity> wrapper) {
 		return baseMapper.selectVO(wrapper);
	}

	@Override
	public List<jianchaxiangmuxinxiView> selectListView(Wrapper<jianchaxiangmuxinxiEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

	@Override
	public jianchaxiangmuxinxiView selectView(Wrapper<jianchaxiangmuxinxiEntity> wrapper) {
		return baseMapper.selectView(wrapper);
	}

}
